#include "SYSTEM/delay/delay.h"
#include "SYSTEM/sys/sys.h"
#include "SYSTEM/usart/usart.h"
#include "BSP/LED/led.h"
#include "BSP/BEEP/beep.h"
#include "BSP/KEY/key.h"
#include "BSP/EXTI/exti.h"
#include "BSP/IWDG/wdg.h"
#include "BSP/GTIMER/gtimer.h"

int main()
{	
	HAL_Init();
	sys_stm32_clock_init(RCC_PLL_MUL9);
	delay_init(72);
	led_init();
	gtim_timx_pwm_chy_init(500 - 1, 72 - 1);
	
	while (1) {
		for (int i = 0; i <= 500; i++) {
			__HAL_TIM_SET_COMPARE(&g_timx_handle, GTIM_TIMX_PWM_CHY, i);
			delay_ms(10);
		}
		for (int i = 500; i >= 0; i--) {
			__HAL_TIM_SET_COMPARE(&g_timx_handle, GTIM_TIMX_PWM_CHY, i);
			delay_ms(10);
		}
	}
}
